package com.mxpio.erp.common.plan.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpio.erp.common.jpa.model.BizOrderLine;
import com.mxpio.erp.common.technology.entity.ItemGroup;
import com.mxpio.erp.common.technology.vo.ItemWithSubExtendsVO;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author : wpp
 * @Datetime : 2023/4/10 11:36
 * @Desc :
 * @Modor :  Modifytime:
 * @modDesc :
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_PLAN_SP_LINE")
@Schema(description="销售预测明细行")
public class SalePredictionLine extends BizOrderLine {

    private static final long serialVersionUID = 1L;


    @Column(name = "ITEM_GROUP_CODE_")
    @Schema(description = "物料组")
    @Dict(dicCode="groupCode", dicEntity = ItemGroup.class, dicText = "groupName")
    private String itemGroupCode;


    @Column(name = "REFERENCE_DATE_")
    @Schema(description = "参考日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date referenceDate;

    @Column(name = "QUANTITY_")
    @Schema(description = "预测数量")
    private BigDecimal quantity;

    @Column(name = "DEMAND_DATE_")
    @Schema(description = "需求日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date demandDate;

    @Column(name = "MEMO_")
    @Schema(description = "备注")
    private String memo;

    @Transient
    private SalePrediction salePrediction;
    @Transient
    private ItemWithSubExtendsVO item;//物料相关信息
}
